/*
 * PaymentMiniView.java
 *
 * Created on June 20, 2008, 10:49 PM
 */

package org.cashforward.ui.payment;

import ca.odell.glazedlists.EventList;
import org.cashforward.model.Label;
import org.cashforward.model.Payee;
import org.cashforward.model.Payment;

/**
 * Experimetal layout of a small Payment interface.
 * 
 * @author  Bill
 */
public class PaymentMiniView extends javax.swing.JPanel {

    Payment payment;
    EventList<Payee> payees;
    
    /** Creates new form PaymentMiniView */
    public PaymentMiniView() {
        initComponents();
    }
    
    public void setPayees(EventList<Payee>payees){
        this.payees = payees;
        //payeeCombo.setModel(new EventListComboBoxModel(payees));
    }

    public void setLabels(EventList<Label>labels){
        
    }
    
    public void setPayment(Payment payment) {
       this.payment = payment;
       descriptionText.setText(payment.getDescription());
       //paymentAmountCombo.getCalculator().setDisplayText(
         //      Float.toString(payment.getAmount()));
       //payeeCombo.setEditable(true);
       //payeeCombo.setSelectedItem(payment.getPayee());
       //spaymentDateChooser.setDate(payment.getStartDate());
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        labelLbl = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        payeeLbl = new javax.swing.JLabel();
        amountLbl = new javax.swing.JLabel();
        descriptionText = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();

        jPanel1.setBackground(new java.awt.Color(204, 204, 255));

        jLabel1.setText(org.openide.util.NbBundle.getMessage(PaymentMiniView.class, "PaymentMiniView.jLabel1.text")); // NOI18N

        org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jLabel1)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jLabel1)
        );

        jLabel7.setText(org.openide.util.NbBundle.getMessage(PaymentMiniView.class, "PaymentMiniView.jLabel7.text")); // NOI18N

        labelLbl.setText(org.openide.util.NbBundle.getMessage(PaymentMiniView.class, "PaymentMiniView.labelLbl.text")); // NOI18N

        jPanel2.setBackground(new java.awt.Color(255, 255, 255));

        payeeLbl.setFont(new java.awt.Font("Tahoma", 0, 18));
        payeeLbl.setText(org.openide.util.NbBundle.getMessage(PaymentMiniView.class, "PaymentMiniView.payeeLbl.text")); // NOI18N

        amountLbl.setFont(new java.awt.Font("Tahoma", 0, 18));
        amountLbl.setForeground(new java.awt.Color(255, 0, 0));
        amountLbl.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        amountLbl.setText(org.openide.util.NbBundle.getMessage(PaymentMiniView.class, "PaymentMiniView.amountLbl.text")); // NOI18N

        descriptionText.setFont(new java.awt.Font("Tahoma", 2, 11));
        descriptionText.setText(org.openide.util.NbBundle.getMessage(PaymentMiniView.class, "PaymentMiniView.descriptionText.text")); // NOI18N

        org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel2Layout.createSequentialGroup()
                        .add(payeeLbl, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 172, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(amountLbl, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 91, Short.MAX_VALUE))
                    .add(descriptionText, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 269, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel2Layout.createSequentialGroup()
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(payeeLbl)
                    .add(amountLbl))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(descriptionText)
                .addContainerGap(5, Short.MAX_VALUE))
        );

        jLabel5.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel5.setForeground(new java.awt.Color(204, 0, 0));
        jLabel5.setText(org.openide.util.NbBundle.getMessage(PaymentMiniView.class, "PaymentMiniView.jLabel5.text")); // NOI18N

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 199, Short.MAX_VALUE)
                .add(jLabel5))
            .add(jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(jLabel7, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 63, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(labelLbl, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 47, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel7)
                    .add(labelLbl, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel amountLbl;
    private javax.swing.JLabel descriptionText;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JLabel labelLbl;
    private javax.swing.JLabel payeeLbl;
    // End of variables declaration//GEN-END:variables

}
